import { DetailApi } from '@/api/news'
import React, { useEffect, useState } from 'react'
import { useParams } from 'react-router-dom'

function Detail() {
    const { id } = useParams()
    const [list, setList] = useState([])
    const getDate = async () => {
        const res = await DetailApi(id)
        console.log(res)
        setList(res)
    }

    useEffect(() => {
        getDate()
    }, [])
    return (
        <div>
            {
            list&&(
                <dl>
                    <dt>{list.title}</dt>
                </dl>
            )
        }
        </div>
    )
}

export default Detail
